<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>鸡兔同笼</title>
</head>

<body>
  <script>
    for (var i = 0; i <= 35; i++) {
      //假设总数-兔的总数等于鸡的总数
      var j = 35 - i;
      console.log(j)
      console.log(j)
      if ((i * 2) + (j * 4) == 96) {
        console.log('鸡' + i + '兔' + j);
        break
      }
    }
  </script>
</body>

</html>